import React from 'react'

export default function Todolist(props) {
  let {iteam,delvalue,change} = props
  // 删除每条数据
let deltext = (id)=>{
  return ()=>{
    delvalue(id)
  }
}
// 改变勾选框
 let  changevalue =(id,type)=>{
return ()=>{
  change(id,type)
}

 }
  return (
   <li>
    <label>
        <input checked={iteam.type} type="checkbox" onChange={changevalue(iteam.id,iteam.type)} />
        <span>{iteam.text}</span>
    </label>
    <button className="btn btn-danger" onClick={deltext(iteam.id)} >删除</button>
</li>

  )
}
